package com.ruoyi.campus.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.campus.mapper.MyCommimagesMapper;
import com.ruoyi.campus.domain.MyCommimages;
import com.ruoyi.campus.service.IMyCommimagesService;

/**
 * 商品图片Service业务层处理
 * 
 * @author zht
 * @date 2021-10-24
 */
@Service
public class MyCommimagesServiceImpl implements IMyCommimagesService 
{
    @Autowired
    private MyCommimagesMapper myCommimagesMapper;

    /**
     * 查询商品图片
     * 
     * @param imgId 商品图片主键
     * @return 商品图片
     */
    @Override
    public MyCommimages selectMyCommimagesByImgId(String imgId)
    {
        return myCommimagesMapper.selectMyCommimagesByImgId(imgId);
    }

    /**
     * 查询商品图片列表
     * 
     * @param myCommimages 商品图片
     * @return 商品图片
     */
    @Override
    public List<MyCommimages> selectMyCommimagesList(MyCommimages myCommimages)
    {
        return myCommimagesMapper.selectMyCommimagesList(myCommimages);
    }

    /**
     * 新增商品图片
     * 
     * @param myCommimages 商品图片
     * @return 结果
     */
    @Override
    public int insertMyCommimages(MyCommimages myCommimages)
    {
        myCommimages.setCreateTime(DateUtils.getNowDate());
        return myCommimagesMapper.insertMyCommimages(myCommimages);
    }

    /**
     * 修改商品图片
     * 
     * @param myCommimages 商品图片
     * @return 结果
     */
    @Override
    public int updateMyCommimages(MyCommimages myCommimages)
    {
        return myCommimagesMapper.updateMyCommimages(myCommimages);
    }

    /**
     * 批量删除商品图片
     * 
     * @param imgIds 需要删除的商品图片主键
     * @return 结果
     */
    @Override
    public int deleteMyCommimagesByImgIds(String[] imgIds)
    {
        return myCommimagesMapper.deleteMyCommimagesByImgIds(imgIds);
    }

    /**
     * 删除商品图片信息
     * 
     * @param imgId 商品图片主键
     * @return 结果
     */
    @Override
    public int deleteMyCommimagesByImgId(String imgId)
    {
        return myCommimagesMapper.deleteMyCommimagesByImgId(imgId);
    }
}
